<template>
  <el-table size="small" v-loading="state.dataListLoading" :data="state.dataList" border @selection-change="state.dataListSelectionChangeHandle" style="width: 100%">
    <el-table-column prop="memberUname" label="归属会员" header-align="center" align="center"></el-table-column>
    <el-table-column prop="type" label="收款方式" header-align="center" align="center">
      <template v-slot="scope">
        {{ state.getDictLabel("platform_payment_methods", scope.row.type) }}
      </template>
    </el-table-column>
    <el-table-column prop="status" label="状态" header-align="center" align="center">
      <template v-slot="scope">
        <dict-label dict-type="yes_no" :dict-value="scope.row.status" :status="{ 0: 'danger' }"></dict-label>
      </template>
    </el-table-column>
    <el-table-column prop="jsonData" show-overflow-tooltip label="卡信息 " header-align="center" align="center"></el-table-column>
    <el-table-column prop="time" label="创建时间" header-align="center" align="center"></el-table-column>
  </el-table>
  <el-pagination :current-page="state.page" :page-sizes="[10, 20, 50, 100]" :page-size="state.limit" :total="state.total" layout="total, sizes, prev, pager, next, jumper" @size-change="state.pageSizeChangeHandle" @current-change="state.pageCurrentChangeHandle"> </el-pagination>
</template>

<script lang="ts" setup>
import { reactive, toRefs } from "vue";
import useView from "@/hooks/useView";

const view = reactive({
  getDataListURL: "/member/memberpaymentmethods/page",
  getDataListIsPage: true,
  createdIsNeed: false,
  dataForm: {
    memberUname: ""
  }
});

const state = reactive({ ...useView(view), ...toRefs(view) });
const init = (row?: any) => {
  view.dataForm.memberUname = row.uname;
  state.getDataList();
};

defineExpose({
  init
});
</script>

<style lang="scss" scoped></style>
